package com.qf.listener;

import com.event.util.EventHandler;
import com.event.util.EventType;
import com.qf.entity.Room;
import com.qf.service.ISearchService;
import com.qf.util.EventTypeContact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@EventType(EventTypeContact.ROOM_PRICE_INSERT)
public class RoomPriceInsertHandler implements EventHandler<Room> {

    @Autowired
    private ISearchService searchService;

    @Override
    public void msgHandler(Room room) {
        System.out.println("新增客房：" + room);

        //调用业务层新增客房信息
        searchService.insertRooms(room);
    }
}
